********************************************************************************
*******************************  TABLE A6  *************************************
**  Effects of Group Gender Composition on Women's Influence (with controls)  **
********************************************************************************
clear all
set more off

//cd "C:/Users/ganth/Dropbox/StrengthInNumbersReplicationPackage/replicable/table_a6"


//ssc install outreg2
//ssc install estout

********************************************************************************


**Team-Building Most Influential Votes
**Study 1 Analysis
use "table_a6_dataset_1.dta", clear

eststo clear
eststo: reg genderminfl_labavg_ratio maleMajority gpa_avg age married ethnic_nonwhite intl, robust
estadd ysumm

**Study 2 Analysis
use "table_a6_dataset_2.dta", clear
eststo: reg genderminfl_ratio_r1 maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm

**Combined Analysis
use "table_a6_dataset_3.dta", clear
eststo: reg genderminfl_ratio_ravg maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm


esttab _all using "table_a6_panel_1.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label replace ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Study 1" "Study 2" "Studies 1 + 2") ///
nonotes nonum


**Team-Building Incentivized Spokesperson Votes
**Study 1 Analysis
use "table_a6_dataset_1.dta", clear
eststo clear
eststo: reg genderspokes_labavg_ratio maleMajority gpa_avg age married ethnic_nonwhite intl, robust
estadd ysumm

**Study 2 Analysis
use "table_a6_dataset_2.dta", clear
eststo: reg genderspokes_ratio_r1 maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm
	

**Combined analysis
use "table_a6_dataset_3.dta", clear
eststo: reg genderspokes_ratio_ravg maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm

esttab _all using "table_a6_panel_2.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Study 1" "Study 2" "Studies 1 + 2") ///
nonotes nonum



**Global Assessment Perceived Most Influential Votes (pre-leader assignment) -- restricted to same groups as completed the team-building task
**Study 1 Analysis
eststo clear
use "table_a6_dataset_1.dta", clear
eststo: reg genderminfl_f2avg_ratio maleMajority gpa_avg age married ethnic_nonwhite intl, robust
estadd ysumm

	
**Study 2 Analysis
use "table_a6_dataset_2.dta", clear
eststo: reg femvotesminfl_avgpre_ratio maleMajority gpa_avg age married ethnic_nonwhite intl if genderlinfl_ravg_ratio!=., robust
estadd ysumm
	
	
**Combined analysis
use "table_a6_dataset_3.dta", clear
eststo: reg femvotesminfl_avgpre_ratio maleMajority gpa_avg age married ethnic_nonwhite intl if genderminfl_ratio_ravg!=., robust
estadd ysumm

esttab _all using "table_a6_panel_3.tex", style(tex)  ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Study 1" "Study 2" "Studies 1 + 2") ///
nonotes nonum

*///

**Team-Building Least Influential Votes

eststo clear
**Study 1 Analysis
use "table_a6_dataset_1.dta", clear
eststo: reg genderlinfl_labavg_ratio maleMajority gpa_avg age married ethnic_nonwhite intl, robust
estadd ysumm

	
**Study 2 Analysis
use "table_a6_dataset_2.dta", clear
eststo: reg genderlinfl_ratio_r1 maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm	
	
**Combined Analysis
use "table_a6_dataset_3.dta", clear
eststo: reg genderlinfl_ratio_ravg maleMajority gpa_avg age married ethnic_nonwhite intl , robust
estadd ysumm


esttab _all using "table_a6_panel_4.tex", style(tex) ///
 stats(ymean ysd, fmt(%9.2f %9.2f) ///
labels("Mean of outcome" "St. dev. of outcome")) label append ///
keep(maleMajority) ///
star( * .1 ** .05 *** .01) b(%9.3f) se(%9.3f) nogaps  ///
mtitles("Study 1" "Study 2" "Studies 1 + 2") ///
nonotes nonum addnotes("\begin{minipage}{.7\linewidth} \footnotesize \smallskip \textbf{Note:} Table presents group-level analysis of the effects of majority male groups on perceptions of influence. In each case, the dependent variable is votes for women divided by the proportion of women in the group. Controls include group-level average GPA, age, race (proportion Nonwhite), marital status (number of married team members), and the presence of an international student. Study 2 analysis excludes 22 groups from the semester when the team-building task was not conducted. Heteroskedasticity-robust standard errors are reported in parentheses. Significance levels are indicated by $*$ $<.1$, ** $<.05$,  *** $<.01$.      \end{minipage} ") 
